<!--
 * @Author: chenr 526963089@qq.com
 * @Date: 2023-02-10 10:19:22
 * @LastEditors: chenr 526963089@qq.com
 * @LastEditTime: 2023-03-01 16:46:51
 * @Description: 全局执行
-->

<template>
  <RouterView />
</template>

<script setup lang="ts">
import { onBeforeUnmount } from 'vue';
import { RouterView } from 'vue-router';
import usePortalRefreshToken from '@portal/hooks/useRefreshToken';
import useUpdateRouter from '@portal/hooks/useUpdateRouter';
const { createRefreshToken, removeRefreshToken } = usePortalRefreshToken();
const { createUpdateRouter } = useUpdateRouter();

createRefreshToken();
createUpdateRouter();

/**
 * @description:  卸载时候关闭定时器任务
 * @return {*}
 */
onBeforeUnmount(() => {
  removeRefreshToken();
});
</script>
